package com.zyd.mappers;

import com.zyd.io.model.SafeEntity;
import com.zyd.io.model.SafeEntityExample;
import com.zyd.io.model.SafeEntityKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface SafeEntityMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_safe
     *
     * @mbg.generated Sat Nov 10 14:41:41 CST 2018
     */
    @SelectProvider(type=SafeEntitySqlProvider.class, method="countByExample")
    long countByExample(SafeEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_safe
     *
     * @mbg.generated Sat Nov 10 14:41:41 CST 2018
     */
    @DeleteProvider(type=SafeEntitySqlProvider.class, method="deleteByExample")
    int deleteByExample(SafeEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_safe
     *
     * @mbg.generated Sat Nov 10 14:41:41 CST 2018
     */
    @Delete({
            "delete from zydzn_safe",
            "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(SafeEntityKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_safe
     *
     * @mbg.generated Sat Nov 10 14:41:41 CST 2018
     */
    @Insert({
            "insert into zydzn_safe (id, salename, ",
            "salemny, saledesc, ",
            "yearnum, dr, ts, ",
            "createid, createtime, ",
            "has_accient, has_third, ",
            "has_theft, other_money, area)",
            "values (#{id,jdbcType=VARCHAR}, #{salename,jdbcType=VARCHAR}, ",
            "#{salemny,jdbcType=DECIMAL}, #{saledesc,jdbcType=VARCHAR}, ",
            "#{yearnum,jdbcType=VARCHAR}, #{dr,jdbcType=INTEGER}, #{ts,jdbcType=VARCHAR}, ",
            "#{createid,jdbcType=VARCHAR}, #{createtime,jdbcType=VARCHAR}, ",
            "#{has_accient,jdbcType=INTEGER}, #{has_third,jdbcType=INTEGER}, ",
            "#{has_theft,jdbcType=INTEGER}, #{other_money,jdbcType=DECIMAL}, #{ara,jdbcType=VARCHAR})"
    })
    int insert(SafeEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_safe
     *
     * @mbg.generated Sat Nov 10 14:41:41 CST 2018
     */
    @InsertProvider(type=SafeEntitySqlProvider.class, method="insertSelective")
    int insertSelective(SafeEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_safe
     *
     * @mbg.generated Sat Nov 10 14:41:41 CST 2018
     */
    @SelectProvider(type=SafeEntitySqlProvider.class, method="selectByExample")
    @Results({
            @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
            @Result(column="salename", property="salename", jdbcType=JdbcType.VARCHAR),
            @Result(column="salemny", property="salemny", jdbcType=JdbcType.DECIMAL),
            @Result(column="saledesc", property="saledesc", jdbcType=JdbcType.VARCHAR),
            @Result(column="yearnum", property="yearnum", jdbcType=JdbcType.VARCHAR),
            @Result(column="dr", property="dr", jdbcType=JdbcType.INTEGER),
            @Result(column="ts", property="ts", jdbcType=JdbcType.VARCHAR),
            @Result(column="createid", property="createid", jdbcType=JdbcType.VARCHAR),
            @Result(column="createtime", property="createtime", jdbcType=JdbcType.VARCHAR),
            @Result(column="has_accient", property="has_accient", jdbcType=JdbcType.INTEGER),
            @Result(column="has_third", property="has_third", jdbcType=JdbcType.INTEGER),
            @Result(column="has_theft", property="has_theft", jdbcType=JdbcType.INTEGER),
            @Result(column="other_money", property="other_money", jdbcType=JdbcType.DECIMAL),
            @Result(column="area", property="area", jdbcType=JdbcType.VARCHAR)
    })
    List<SafeEntity> selectByExample(SafeEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_safe
     *
     * @mbg.generated Sat Nov 10 14:41:41 CST 2018
     */
    @Select({
            "select",
            "id, salename, salemny, saledesc, yearnum, dr, ts, createid, createtime, has_accient, ",
            "has_third, has_theft, other_money,area",
            "from zydzn_safe",
            "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
            @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
            @Result(column="salename", property="salename", jdbcType=JdbcType.VARCHAR),
            @Result(column="salemny", property="salemny", jdbcType=JdbcType.DECIMAL),
            @Result(column="saledesc", property="saledesc", jdbcType=JdbcType.VARCHAR),
            @Result(column="yearnum", property="yearnum", jdbcType=JdbcType.VARCHAR),
            @Result(column="dr", property="dr", jdbcType=JdbcType.INTEGER),
            @Result(column="ts", property="ts", jdbcType=JdbcType.VARCHAR),
            @Result(column="createid", property="createid", jdbcType=JdbcType.VARCHAR),
            @Result(column="createtime", property="createtime", jdbcType=JdbcType.VARCHAR),
            @Result(column="has_accient", property="has_accient", jdbcType=JdbcType.INTEGER),
            @Result(column="has_third", property="has_third", jdbcType=JdbcType.INTEGER),
            @Result(column="has_theft", property="has_theft", jdbcType=JdbcType.INTEGER),
            @Result(column="other_money", property="other_money", jdbcType=JdbcType.DECIMAL),
            @Result(column="area", property="area", jdbcType=JdbcType.VARCHAR)
    })
    SafeEntity selectByPrimaryKey(SafeEntityKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_safe
     *
     * @mbg.generated Sat Nov 10 14:41:41 CST 2018
     */
    @UpdateProvider(type=SafeEntitySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") SafeEntity record, @Param("example") SafeEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_safe
     *
     * @mbg.generated Sat Nov 10 14:41:41 CST 2018
     */
    @UpdateProvider(type=SafeEntitySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") SafeEntity record, @Param("example") SafeEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_safe
     *
     * @mbg.generated Sat Nov 10 14:41:41 CST 2018
     */
    @UpdateProvider(type=SafeEntitySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(SafeEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_safe
     *
     * @mbg.generated Sat Nov 10 14:41:41 CST 2018
     */
    @Update({
            "update zydzn_safe",
            "set salename = #{salename,jdbcType=VARCHAR},",
            "salemny = #{salemny,jdbcType=DECIMAL},",
            "saledesc = #{saledesc,jdbcType=VARCHAR},",
            "yearnum = #{yearnum,jdbcType=VARCHAR},",
            "dr = #{dr,jdbcType=INTEGER},",
            "ts = #{ts,jdbcType=VARCHAR},",
            "createid = #{createid,jdbcType=VARCHAR},",
            "createtime = #{createtime,jdbcType=VARCHAR},",
            "has_accient = #{has_accient,jdbcType=INTEGER},",
            "has_third = #{has_third,jdbcType=INTEGER},",
            "has_theft = #{has_theft,jdbcType=INTEGER},",
            "other_money = #{other_money,jdbcType=DECIMAL}",
            "area = #{area,jdbcType=VARCHAR}",
            "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(SafeEntity record);
}